import { Descriptions, Drawer } from 'antd';
import { ContractManageAPI } from '../common/type';
import pageStyles from '@/common/pageLayout.less';
import ScrollBarLayout from '@/components/ScrollBarLayout';
// import MyIcon from '@/components/MyIcon';

/** 查看相对方详情 */
export const CounterpartDetailDrawer: React.FC<ContractManageAPI.ICounterpartDetailDrawer> = ({ openDrawer, dataInfo, onClose }) => {
  return (
    <Drawer
      title="相对方详情"
      className={pageStyles['detailDrawerDes']}
      style={{
        position: 'absolute',
        height: '100%',
        overflow: 'hidden',
      }}
      onClose={onClose}
      open={openDrawer}
      placement="right"
      getContainer={false}
      width={document.body?.clientWidth * 0.45}
      bodyStyle={{ padding: '5px 0' }}
      closable={false}
      destroyOnClose={true}
    >
      <ScrollBarLayout style={{ padding: '5px 10px' }}>
        <Descriptions bordered={true} size="small" column={2} labelStyle={{ width: 190 }}>
          <Descriptions.Item
            span={2}
            label={
              <>
                {/* <MyIcon type={'icon-bumen'} /> */}
                &nbsp;单位名称
              </>
            }
          >
            <div>{dataInfo?.oppositeName || '--'}</div>
          </Descriptions.Item>
          <Descriptions.Item
            span={2}
            label={
              <>
                {/* <MyIcon type={'icon-bumen'} /> */}
                &nbsp;企业属性
              </>
            }
          >
            <div>{dataInfo?.enterpriseType == 0 ? '大陆' : dataInfo?.enterpriseType == 1 ? '港澳台' : dataInfo?.enterpriseType == 2 ? '境外' : '--'}</div>
          </Descriptions.Item>

          <Descriptions.Item
            label={
              <>
                {/* <MyIcon type={'icon-faren'} /> */}
                &nbsp;法定代表人
              </>
            }
          >
            <div>{dataInfo?.legalName || '--'}</div>
          </Descriptions.Item>
          <Descriptions.Item
            label={
              <>
                {/* <MyIcon type={'icon-faren'} /> */}
                &nbsp;所属区域
              </>
            }
          >
            <div>{dataInfo?.registerAddress || '--'}</div>
          </Descriptions.Item>

          <Descriptions.Item label={dataInfo?.enterpriseType ? <>&nbsp;企业注册代码</> : <>&nbsp;统一社会信用代码</>}>
            <div>{dataInfo?.creditID || '--'}</div>
          </Descriptions.Item>
          <Descriptions.Item
            label={
              <>
                {/* <MyIcon type={'icon-dianhua'} /> */}
                &nbsp;注册电话
              </>
            }
          >
            <div>{dataInfo?.registerPhone || '--'}</div>
          </Descriptions.Item>

          {/* 
          <Descriptions.Item
            label={
              <>
                <MyIcon type={'icon-dai'} />
                &nbsp;授权代表
              </>
            }
          >
            <div>{dataInfo?.authName || '--'}</div>
          </Descriptions.Item> */}

          <Descriptions.Item
            label={
              <>
                {/* <MyIcon type={'icon-lianxiren'} /> */}
                &nbsp;联系人
              </>
            }
          >
            <div>{dataInfo?.contactName || '--'}</div>
          </Descriptions.Item>
          <Descriptions.Item
            label={
              <>
                {/* <MyIcon type={'icon-dianhua'} /> */}
                &nbsp;联系电话
              </>
            }
          >
            <div>{dataInfo?.phoneMobile || '--'}</div>
          </Descriptions.Item>

          <Descriptions.Item label={<>&nbsp;开户行名称</>}>
            <div>{dataInfo?.bankName || '--'}</div>
          </Descriptions.Item>
          <Descriptions.Item label={<>&nbsp;开户行账号</>}>
            <div>{dataInfo?.bankAccount || '--'}</div>
          </Descriptions.Item>
          <Descriptions.Item label={<>&nbsp;银行行号</>}>
            <div>{dataInfo?.bankCode || '--'}</div>
          </Descriptions.Item>
          <Descriptions.Item label={<>&nbsp;单位地址</>}>
            <div>{dataInfo?.workAddress || '--'}</div>
          </Descriptions.Item>
        </Descriptions>
      </ScrollBarLayout>
    </Drawer>
  );
};
